﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace chihuopig.Web.verfiy
{
    public class RoleAdminEditVefiy
    {
        [MaxLength(20, ErrorMessage = "用户名最大长度20")]
        [Required(ErrorMessage = "用户名不能为空")]
        //[ChenckPhone(ErrorMessage ="测试，手机号不能为空")]
        public string username { get; set; }

        [MaxLength(20, ErrorMessage = "密码最大长度20")]
        [Required(ErrorMessage = "密码不能为空")]
        public string pass { get; set; }

        [MaxLength(20, ErrorMessage = "密码最大长度20")]
        [Required(ErrorMessage = "密码不能为空")]
        [Compare("pass", ErrorMessage = "两次密码不一致")]
        public string repass { get; set; }

        [Required(ErrorMessage = "密码不能为空")]
        [RoleAdmin(ErrorMessage = "请选择角色")]
        public long[] RoleId { get; set; }

        [Required(ErrorMessage = "Id不能为空")]
        public long AdminId { get; set; }
    }
}
